Skip to content

compression: add zstd compressor and decompressor#20434

Merged
mattklein123 merged 9 commits intoenvoyproxy:mainfrom
rainingmaster:zstd
Apr 11, 2022
Merged

compression: add zstd compressor and decompressor#20434
mattklein123 merged 9 commits intoenvoyproxy:mainfrom
rainingmaster:zstd

Conversation

@rainingmaster
Copy link
Contributor

@rainingmaster rainingmaster commented Mar 21, 2022

Hi! We are from the Service Mesh team at ByteDance and are excited to have the opportunity to contribute to Envoy. Zstd is Facebook's open source compression algorithm, and it is getting more and more attention. In ByteDance's Service Mesh, zstd is also being used more and more. Therefore, we hope envoy can integrate this algorithm and let more people use it.


Commit Message: compression: add zstd compressor and decompressor
Additional Description: Like #12998, add new zstd(alson name as Zstandard) compression extensions in addition to gzip, brotli.
Risk Level: Low, add context for createCompressorFactoryFromProtoTyped in exist code.
Testing: uni tests, manual tests with curl.
Docs Changes: updated docs for compression and decompression HTTP filters to refer the new available encoder/decoder.
Release Notes: updated current.rst


The PR adds a new dependency on https://github.com/facebook/zstd. Here's the current criteria answers:

Criteria Answer
Cloud Native Computing Foundation (CNCF) approved license BSD
Dependencies must not substantially increase the binary size unless they are optional origin: 326M, new: 330M
No duplication of existing dependencies no other dep provides zstd
Hosted on a git repository and the archive fetch must directly reference this repository. https://github.com/facebook/zstd
CVE history appears reasonable, no pathological CVE arcs. so far 3 CVEs related to zstd have been registered: https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=zstd
Code review (ideally PRs) before merge. PRs are reviewed before merge
Security vulnerability process exists, with contact details and reporting/disclosure process. https://github.com/facebook/zstd/blob/dev/CONTRIBUTING.md#issues
> 1 contributor responsible for a non-trivial number of commits. 242 contributors
Tests run in CI. CI set up with Travis CI
High test coverage (also static/dynamic analysis, fuzzing). Fuzzers are run in CI
Envoy can obtain advanced notification of vulnerabilities or of security releases. zstd is registered in CPE
Do other significant projects have shared fate by using this dependency? The Linux kernel has included Zstandard since November 2017 (version 4.14) as a compression method for the btrfs and squashfs filesystems
Releases (with release notes). https://github.com/facebook/zstd/releases
Commits/releases in last 90 days. last commit 2 days ago

@repokitteh-read-only repokitteh-read-only bot added api deps Approval required for changes to Envoy's external dependencies labels Mar 21, 2022
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @mattklein123

🐱

Caused by: #20434 was opened by rainingmaster.

see: more, trace.

@rainingmaster rainingmaster changed the title compression: add zstd compressor and decompressor WIP: compression: add zstd compressor and decompressor Mar 21, 2022
@mattklein123 mattklein123 assigned rojkov and unassigned mattklein123 Mar 21, 2022
@mattklein123
Copy link
Member

I'm assigning this over to @rojkov as compression expert.

Also, can you please provide some context and rational for this feature? In general for something this large we require sponsorship and an issue tracking the feature addition. Without sponshorship this will need to go into contrib. Thank you.

@rainingmaster
Copy link
Contributor Author

I'm assigning this over to @rojkov as compression expert.

Also, can you please provide some context and rational for this feature? In general for something this large we require sponsorship and an issue tracking the feature addition. Without sponshorship this will need to go into contrib. Thank you.

Thanks for your help and reminder! I will provide the required information after fixing the CI error.

@rainingmaster rainingmaster force-pushed the zstd branch 2 times, most recently from aec29c2 to 23f2966 Compare March 21, 2022 15:58
@moderation
Copy link
Contributor

scorecard --repo=https://github.com/facebook/zstd/

RESULTS
-------
Aggregate score: 6.6 / 10

Check scores:
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
|  SCORE  |          NAME          |             REASON             |                             DOCUMENTATION/REMEDIATION                             |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Binary-Artifacts       | no binaries found in the repo  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#binary-artifacts       |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 1 / 10  | Branch-Protection      | branch protection is not       | https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection      |
|         |                        | maximal on development and all |                                                                                   |
|         |                        | release branches               |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | CI-Tests               | 30 out of 30 merged PRs        | https://github.com/ossf/scorecard/blob/main/docs/checks.md#ci-tests               |
|         |                        | checked by a CI test -- score  |                                                                                   |
|         |                        | normalized to 10               |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | CII-Best-Practices     | no badge detected              | https://github.com/ossf/scorecard/blob/main/docs/checks.md#cii-best-practices     |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Code-Review            | all last 30 commits are        | https://github.com/ossf/scorecard/blob/main/docs/checks.md#code-review            |
|         |                        | reviewed through GitHub        |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Contributors           | 15 different companies found   | https://github.com/ossf/scorecard/blob/main/docs/checks.md#contributors           |
|         |                        | -- score normalized to 10      |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Dangerous-Workflow     | no dangerous workflow patterns | https://github.com/ossf/scorecard/blob/main/docs/checks.md#dangerous-workflow     |
|         |                        | detected                       |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | Dependency-Update-Tool | no update tool detected        | https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Fuzzing                | project is fuzzed in OSS-Fuzz  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#fuzzing                |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | License                | license file detected          | https://github.com/ossf/scorecard/blob/main/docs/checks.md#license                |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Maintained             | 30 commit(s) out of 30 and 0   | https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained             |
|         |                        | issue activity out of 30 found |                                                                                   |
|         |                        | in the last 90 days -- score   |                                                                                   |
|         |                        | normalized to 10               |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| ?       | Packaging              | no published package detected  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#packaging              |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 6 / 10  | Pinned-Dependencies    | dependency not pinned by hash  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies    |
|         |                        | detected -- score normalized   |                                                                                   |
|         |                        | to 6                           |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | SAST                   | SAST tool is not run on all    | https://github.com/ossf/scorecard/blob/main/docs/checks.md#sast                   |
|         |                        | commits -- score normalized to |                                                                                   |
|         |                        | 0                              |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Security-Policy        | security policy file detected  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#security-policy        |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 6 / 10  | Signed-Releases        | 3 out of 5 artifacts are       | https://github.com/ossf/scorecard/blob/main/docs/checks.md#signed-releases        |
|         |                        | signed -- score normalized to  |                                                                                   |
|         |                        | 6                              |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | Token-Permissions      | non read-only tokens detected  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions      |
|         |                        | in GitHub workflows            |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Vulnerabilities        | no vulnerabilities detected    | https://github.com/ossf/scorecard/blob/main/docs/checks.md#vulnerabilities        |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|

@rainingmaster rainingmaster force-pushed the zstd branch 2 times, most recently from 0703485 to 44e0edf Compare March 22, 2022 02:38
@rainingmaster rainingmaster requested a review from lizan as a code owner March 22, 2022 02:38
@rainingmaster rainingmaster force-pushed the zstd branch 2 times, most recently from 17c6902 to f845d56 Compare March 22, 2022 08:34
@rojkov
Copy link
Member

rojkov commented Mar 22, 2022

You can turn this PR into a draft until it's ready for review. After the PR is ready please avoid force-pushing.

@rainingmaster rainingmaster marked this pull request as draft March 22, 2022 09:51
@rainingmaster rainingmaster changed the title WIP: compression: add zstd compressor and decompressor compression: add zstd compressor and decompressor Mar 22, 2022
@rainingmaster
Copy link
Contributor Author

You can turn this PR into a draft until it's ready for review. After the PR is ready please avoid force-pushing.

Thanks for your remind, done

@rainingmaster rainingmaster force-pushed the zstd branch 2 times, most recently from caaa029 to 6246571 Compare March 22, 2022 12:31
@rojkov
Copy link
Member

rojkov commented Mar 24, 2022

I've discussed the feature with my colleagues. Intel needs it as a benchmark for the upcoming zSTD acceleration in QuickAssist HW and is willing to support it together with ByteDance.

@rainingmaster Could you please file an issue for the feature, so I could state my sponsorship?

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20434 (comment) was created by @rainingmaster.

see: more, trace.

@rainingmaster
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20434 (comment) was created by @rainingmaster.

see: more, trace.

@markdroth
Copy link
Contributor

/lgtm api

@repokitteh-read-only repokitteh-read-only bot removed the api label Apr 7, 2022
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM with tiny comment.

/wait

@rainingmaster
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20434 (comment) was created by @rainingmaster.

see: more, trace.

@rainingmaster
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20434 (comment) was created by @rainingmaster.

see: more, trace.

Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
@rainingmaster
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20434 (comment) was created by @rainingmaster.

see: more, trace.

Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
@rainingmaster
Copy link
Contributor Author

Hi, @mattklein123 . I think we are very close now, could you help me review again? Thanks!

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@repokitteh-read-only repokitteh-read-only bot removed api deps Approval required for changes to Envoy's external dependencies labels Apr 11, 2022
@mattklein123 mattklein123 merged commit 8655952 into envoyproxy:main Apr 11, 2022
vehre-x41 pushed a commit to vehre-x41/envoy that referenced this pull request Apr 19, 2022
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Signed-off-by: Andre Vehreschild <vehre@x41-dsec.de>
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
Signed-off-by: rainingmaster <jinhua.tan@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants